﻿<UserControl x:Class="IntegrationTool.Module.ConcatenateColumns.ConfigurationWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <DataTemplate x:Key="ColumnConcatenationTemplate">
            <Grid x:Name="ColumnConcatenationTemplateGrid">
                <Grid.ColumnDefinitions>

                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="117*"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="70"/>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="117*"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="117*"/>
                </Grid.ColumnDefinitions>

                <Label Content="Left column"/>
                <ComboBox x:Name="ddLeftColumn" SelectedValue="{Binding Path=LeftColumn}" SelectedValuePath="Tag" Grid.Column="2" VerticalAlignment="Top"  Height="22" />

                <Label Content="Separator" Grid.Column="4"/>
                <TextBox x:Name="tbSeparator" Grid.Column="5" Height="23" Text="{Binding ColumnSeparation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" />

                <Label Content="Right column" Grid.Column="7"/>
                <ComboBox x:Name="ddRightColumn" Grid.Column="9" Height="23" SelectedValue="{Binding Path=RightColumn}" SelectedValuePath="Tag" VerticalAlignment="Top" />

                <Label Content="Output column" Grid.Column="11"/>
                <TextBox x:Name="tbOutputColumn" Grid.Column="12" Height="23" Text="{Binding OutputColumn, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" />
                <Label x:Name="DataTemplateLoaded" Visibility="Hidden" Content="DataTemplateLoadedControl" Loaded="DataTemplateLoaded_Loaded" />
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="10"/>
            <RowDefinition Height="23"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="248*"/>
            <RowDefinition Height="10"/>
        </Grid.RowDefinitions>
        <ListBox Grid.Row="3" ItemsSource="{Binding Path=ColumnConcatenations}" ItemTemplate="{StaticResource ColumnConcatenationTemplate}">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>
        <Button x:Name="AddNewConcatenation" Content="Add" HorizontalAlignment="Right" Margin="0,2,10,0" Grid.Row="1" VerticalAlignment="Top" Width="75"  Click="AddNewConcatenation_Click"/>
        <Label Content="List of concatenations" Grid.Row="1" Margin="0,0,170,0"/>

    </Grid>
</UserControl>
